﻿@{ ViewBag.Title = "jqGrid in ASP.NET MVC - TreeGrid"; }

<table id="jqgFileSystemInfos" cellpadding="0" cellspacing="0"></table>

@section JavaScript {
    <script type="text/javascript">
        $(document).ready(function () {
            $('#jqgFileSystemInfos').jqGrid({
                //enabled TreeGrid
                treeGrid: true,
                //set TreeGrid model
                treeGridModel: 'adjacency',
                //set expand column
                ExpandColumn: 'Name',
                //url from wich data should be requested
                url: '@Url.Action("FileSystemInfos")',
                //type of data
                datatype: 'json',
                //url access method type
                mtype: 'POST',
                //columns names
                colNames: ['Name', 'CreationTime', 'LastAccessTime', 'LastWriteTime'],
                //columns model
                colModel: [
                            { name: 'Name', index: 'Name', align: 'left' },
                            { name: 'CreationTime', index: 'CreationTime', align: 'left' },
                            { name: 'LastAccessTime', index: 'LastAccessTime', align: 'left' },
                            { name: 'LastWriteTime', index: 'LastWriteTime', align: 'left' }
                            ],
                //grid height
                height: '100%',
                //all rows
                rowNum: -1
            });
        });
    </script>
}